﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NormReference.Models;

namespace NormReference.Services
{
    public class ComparisonGroupQueue
    {
        private static ComparisonGroupQueue instance;
        private Queue<ComparisonGroup> groupQueue;

        private ComparisonGroupQueue()
        {
            groupQueue = new Queue<ComparisonGroup>();
        }

        public static ComparisonGroupQueue getInstance()
        {
            if (instance == null)
            {
                instance = new ComparisonGroupQueue();
            }

            return instance;
        }

        public void Enqueue(ComparisonGroup newGroup) 
        {
            groupQueue.Enqueue(newGroup);
        }

        public ComparisonGroup Dequeue()
        {
            return groupQueue.Dequeue();
        }

        public bool IsEmpty()
        {
            return groupQueue.Count == 0;
        }

        public int Size()
        {
            return groupQueue.Count;
        }
    }
}